package solutions;

/*
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

What is the 10 001st prime number?
 
*/

public class Euler007 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		long number = 1, count = 1;
		while(count < 10001){
			
			number += 2;
//			System.out.println("Number: " + number);
			if( prime(number) ){
				count++;
				System.out.println(count);
			}
		}

		System.out.println("Answer: " + number);
	}

	
	public static boolean prime(long number){
	
		for(long i = 2; i <= (long)Math.sqrt((double) number); i++){
			if(number % i == 0)
				return false;
		}

		return true;
		
		
	}
	
	
	
}
